/*
 * Copyright (C) 2014 The NewEit Project
 *
 * Innofidei, Inc. All rights reserved
 * 
 */

package com.jason.location.utils;

import android.app.ActivityManager;
import android.app.ActivityManager.RunningServiceInfo;
import android.content.Context;

public class ServiceUtil {
    public static boolean isServiceRunning(Context mContext, String serviceName) {
        ActivityManager manager = (ActivityManager) mContext
                .getSystemService(Context.ACTIVITY_SERVICE);
        for (RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) {
            if (serviceName.equals(service.service.getClassName())) {
                return true;
            }
        }
        return false;
    }
}
